<%+cbi/valueheader%>

<script type="text/javascript">//<![CDATA[

	function refresh_data(btn,dataname)
	{
		btn.disabled = true;
		btn.value    = '<%:Refresh...%> ';
		murl=dataname;
		XHR.get('<%=luci.dispatcher.build_url("admin", "network", "shadowsocksr","refresh")%>',
			{ set:murl },
			function(x,rv) {
				var s = document.getElementById(dataname+'-status');
				if (s) {
					if (rv.ret=="0")
					s.innerHTML ="<font color='green'>"+"<%:Already up to date!%> "+"</font>";
					else if(rv.ret=="-1")
					{
						s.innerHTML ="<font color='red'>"+"<%:Refresh Error!%> "+"</font>";
					} else {
						s.innerHTML ="<font color='green'>"+"<%:Refresh Success!%> "+"<%:Total Records:%>"+rv.ret+"</font>";
					}
				}
				btn.disabled = false;
				btn.value    = '<%:Refresh Data%>';
			}
		);

		return false;
	}
//]]></script>


<input type="button" class="cbi-button cbi-input-reload" value="<%:Refresh Data%> " onclick="return refresh_data(this,'<%=self.option%>')" />
<span id="<%=self.option%>-status"><em><%=self.value%></em></span>

<%+cbi/valuefooter%>